*
* Convert from a "bare" file representation into an
* OSTREE_OBJECT_TYPE_FILE stream suitable for ostree pull.
+ *
+ * Since: 2016.6
*/
gboolean
ostree_raw_file_to_archive_z2_stream (GInputStream *input,
* @input_length: Length of stream
* @trusted: If %TRUE, assume the content has been validated
* @out_input: (out): The raw file content stream
- * @out_file_info: (out): Normal metadata
+ * @out_file_info: (out): Normal metadata
* @out_xattrs: (out): Extended attributes
* @cancellable: Cancellable
* @error: Error
* @path: Subpath
* @trusted: If %TRUE, assume the content has been validated
* @out_input: (out): The raw file content stream
- * @out_file_info: (out): Normal metadata
+ * @out_file_info: (out): Normal metadata
* @out_xattrs: (out): Extended attributes
* @cancellable: Cancellable
* @error: Error
* @content_path: Path to file containing content
* @trusted: If %TRUE, assume the content has been validated
* @out_input: (out): The raw file content stream
- * @out_file_info: (out): Normal metadata
+ * @out_file_info: (out): Normal metadata
* @out_xattrs: (out): Extended attributes
* @cancellable: Cancellable
* @error: Error
g_free (data->csum);
g_free (data);
}
-
+
/**
* ostree_checksum_file_async:
* @f: File path
res = g_simple_async_result_new (G_OBJECT (f), callback, user_data, ostree_checksum_file_async);
g_simple_async_result_set_op_res_gpointer (res, data, (GDestroyNotify)checksum_file_async_data_free);
-
+
g_simple_async_result_run_in_thread (res, checksum_file_async_thread, io_priority, cancellable);
g_object_unref (res);
}
const char *checksum;
OstreeObjectType objtype;
gint objtype_int;
-
+
ostree_object_name_deserialize (variant, &checksum, &objtype);
objtype_int = (gint) objtype;
return g_str_hash (checksum) + g_int_hash (&objtype_int);
* @checksum: An ASCII checksum
*
* Returns: (transfer full) (array fixed-size=32): Binary version of @checksum.
+ *
+ * Since: 2016.8
*/
guchar *
ostree_checksum_b64_to_bytes (const char *checksum)
*
* The "modified" term refers to the fact that instead of '/', the '_'
* character is used.
+ *
+ * Since: 2016.8
*/
char *
ostree_checksum_b64_from_bytes (const guchar *csum)
g_string_append_c (ret, '/');
g_string_append (ret, target);
}
-
+
return g_string_free (ret, FALSE);
}
* ostree_validate_structureof_commit:
* @commit: A commit object, %OSTREE_OBJECT_TYPE_COMMIT
* @error: Error
- *
+ *
* Use this to validate the basic structure of @commit, independent of
* any other objects it references.
*
* ostree_validate_structureof_dirtree:
* @dirtree: A dirtree object, %OSTREE_OBJECT_TYPE_DIR_TREE
* @error: Error
- *
+ *
* Use this to validate the basic structure of @dirtree, independent of
* any other objects it references.
*
* ostree_validate_structureof_dirmeta:
* @dirmeta: A dirmeta object, %OSTREE_OBJECT_TYPE_DIR_META
* @error: Error
- *
+ *
* Use this to validate the basic structure of @dirmeta.
*
* Returns: %TRUE if @dirmeta is structurally valid
if (!validate_variant (dirmeta, OSTREE_DIRMETA_GVARIANT_FORMAT, error))
return FALSE;
- g_variant_get_child (dirmeta, 2, "u", &mode);
+ g_variant_get_child (dirmeta, 2, "u", &mode);
mode = GUINT32_FROM_BE (mode);
if (!S_ISDIR (mode))
* root "dirmeta" checksum (both in binary form, not hexadecimal).
*
* Returns: (nullable): A SHA-256 hex string, or %NULL if @commit_variant is not well-formed
+ *
+ * Since: 2018.2
*/
gchar *
ostree_commit_get_content_checksum (GVariant *commit_variant)
* @required_release: Release version required
*
* Returns: %TRUE if current libostree has at least the requested version, %FALSE otherwise
+ *
+ * Since: 2017.4
*/
gboolean
ostree_check_version (guint required_year, guint required_release)
ostree_deployment_get_deployserial (self));
}
+/**
+ * ostree_deployment_unlocked_state_to_string:
+ *
+ * Since: 2016.4
+ */
const char *
ostree_deployment_unlocked_state_to_string (OstreeDeploymentUnlockedState state)
{
g_assert_not_reached ();
}
+/**
+ * ostree_deployment_get_unlocked:
+ *
+ * Since: 2016.4
+ */
OstreeDeploymentUnlockedState
ostree_deployment_get_unlocked (OstreeDeployment *self)
{
*
* Compute the difference between directory @a and @b as 3 separate
* sets of #OstreeDiffItem in @modified, @removed, and @added.
+ *
+ * Since: 2017.4
*/
gboolean
ostree_diff_dirs_with_options (OstreeDiffFlags flags,
{
OstreeRepoFile *a_repof = (OstreeRepoFile*) a;
OstreeRepoFile *b_repof = (OstreeRepoFile*) b;
-
+
if (strcmp (ostree_repo_file_tree_get_contents_checksum (a_repof),
ostree_repo_file_tree_get_contents_checksum (b_repof)) == 0)
{
g_clear_object (&child_a_info);
g_clear_object (&child_b_info);
- dir_enum = g_file_enumerate_children (a, OSTREE_GIO_FAST_QUERYINFO,
+ dir_enum = g_file_enumerate_children (a, OSTREE_GIO_FAST_QUERYINFO,
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
cancellable, error);
if (!dir_enum)
{
OstreeDiffItem *diff_item = diff_item_new (child_a, child_a_info,
child_b, child_b_info, NULL, NULL);
-
+
g_ptr_array_add (modified, diff_item);
}
else
if (!diff_files (flags, child_a, child_a_info, child_b, child_b_info, &diff_item,
cancellable, error))
goto out;
-
+
if (diff_item)
g_ptr_array_add (modified, diff_item); /* Transfer ownership */
}
}
}
-
+
g_clear_object (&child_a_info);
}
if (temp_error != NULL)
}
g_clear_object (&dir_enum);
- dir_enum = g_file_enumerate_children (b, OSTREE_GIO_FAST_QUERYINFO,
+ dir_enum = g_file_enumerate_children (b, OSTREE_GIO_FAST_QUERYINFO,
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
cancellable, error);
if (!dir_enum)
*
* Returns: %TRUE if @result was not %NULL and had at least one
* signature from trusted keyring, otherwise %FALSE
+ *
+ * Since: 2016.6
*/
gboolean
ostree_gpg_verify_result_require_valid_signature (OstreeGpgVerifyResult *result,
OSTREE_GPG_ERROR_MISSING_KEY,
} OstreeGpgError;
+/**
+ * ostree_gpg_error_quark:
+ *
+ * Since: 2017.10
+ */
_OSTREE_PUBLIC
GQuark ostree_gpg_error_quark (void);
#define OSTREE_GPG_ERROR (ostree_gpg_error_quark ())
* @error: a #GError
*
* Remove the file or subdirectory named @name from the mutable tree @self.
+ *
+ * Since: 2018.9
*/
gboolean
ostree_mutable_tree_remove (OstreeMutableTree *self,
* This function enables optimisations when composing trees. The provided
* checksums are not loaded or checked when this function is called. Instead
* the contents will be loaded only when needed.
+ *
+ * Since: 2018.7
*/
gboolean
ostree_mutable_tree_fill_empty_from_dirtree (OstreeMutableTree *self,
/**
* ostree_mutable_tree_get_subdirs:
* @self:
- *
+ *
* Returns: (transfer none) (element-type utf8 OstreeMutableTree): All children directories
*/
GHashTable *
/**
* ostree_mutable_tree_get_files:
* @self:
- *
+ *
* Returns: (transfer none) (element-type utf8 utf8): All children files (the value is a checksum)
*/
GHashTable *
* and checksums. The data will be loaded from the repo lazily as needed.
*
* Returns: (transfer full): A new tree
+ *
+ * Since: 2018.7
*/
OstreeMutableTree *
ostree_mutable_tree_new_from_checksum (OstreeRepo *repo,
*/
g_mutex_lock (&repo->cache_lock);
{
- gpointer key = GUINT_TO_POINTER ((g_ascii_xdigit_value (checksum[0]) << 4) +
+ gpointer key = GUINT_TO_POINTER ((g_ascii_xdigit_value (checksum[0]) << 4) +
g_ascii_xdigit_value (checksum[1]));
if (repo->updated_uncompressed_dirs == NULL)
repo->updated_uncompressed_dirs = g_hash_table_new (NULL, NULL);
* Note in addition that unlike ostree_repo_checkout_tree(), the
* default is not to use the repository-internal uncompressed objects
* cache.
+ *
+ * Since: 2016.8
*/
gboolean
ostree_repo_checkout_at (OstreeRepo *self,
*
* Note that cache does *not* have its refcount incremented - the lifetime of
* @cache must be equal to or greater than that of @opts.
+ *
+ * Since: 2017.13
*/
void
ostree_repo_checkout_at_options_set_devino (OstreeRepoCheckoutAtOptions *opts,
/**
* ostree_repo_devino_cache_new:
- *
+ *
* OSTree has support for pairing ostree_repo_checkout_tree_at() using
* hardlinks in combination with a later
* ostree_repo_write_directory_to_mtree() using a (normally modified)
* @error: GError
*
* Like ostree_repo_set_ref_immediate(), but creates an alias.
+ *
+ * Since: 2017.10
*/
gboolean
ostree_repo_set_alias_ref_immediate (OstreeRepo *self,
* statistics on objects that would be deleted, without actually deleting them.
*
* Locking: exclusive
+ *
+ * Since: 2017.1
*/
gboolean
ostree_repo_prune_from_reachable (OstreeRepo *self,
static void
content_fetch_on_complete (GObject *object,
GAsyncResult *result,
- gpointer user_data)
+ gpointer user_data)
{
OstreeFetcher *fetcher = (OstreeFetcher *)object;
FetchObjectData *fetch_data = user_data;
g_autofree guchar *csum = NULL;
g_autofree char *stringified_object = NULL;
- if (!ostree_repo_write_metadata_finish ((OstreeRepo*)object, result,
+ if (!ostree_repo_write_metadata_finish ((OstreeRepo*)object, result,
&csum, error))
goto out;
* means return errors without retrying
*
* Returns: %TRUE on success, %FALSE on failure
+ *
+ * Since: 2016.6
*/
gboolean
ostree_repo_remote_fetch_summary_with_options (OstreeRepo *self,
*
* The flag %OSTREE_REPO_RESOLVE_REV_EXT_LOCAL_ONLY is implied so
* using it has no effect.
+ *
+ * Since: 2016.7
*/
gboolean
ostree_repo_resolve_rev_ext (OstreeRepo *self,
* @out_all_refs will be returned as a mapping from refspecs (including the
* remote name) to checksums. Differently from ostree_repo_list_refs(), the
* @refspec_prefix will not be removed from the refspecs in the hash table.
+ *
+ * Since: 2016.4
*/
gboolean
ostree_repo_list_refs_ext (OstreeRepo *self,
* option name. If an error is returned, @out_value will be set to %NULL.
*
* Returns: %TRUE on success, otherwise %FALSE with @error set
+ *
+ * Since: 2016.5
*/
gboolean
ostree_repo_get_remote_option (OstreeRepo *self,
* to %NULL.
*
* Returns: %TRUE on success, otherwise %FALSE with @error set
+ *
+ * Since: 2016.5
*/
gboolean
ostree_repo_get_remote_list_option (OstreeRepo *self,
* error is returned, @out_value will be set to %FALSE.
*
* Returns: %TRUE on success, otherwise %FALSE with @error set
+ *
+ * Since: 2016.5
*/
gboolean
ostree_repo_get_remote_boolean_option (OstreeRepo *self,
* already extant repository. If you want to create one, use ostree_repo_create_at().
*
* Returns: (transfer full): An accessor object for an OSTree repository located at @dfd + @path
+ *
+ * Since: 2017.10
*/
OstreeRepo*
ostree_repo_open_at (int dfd,
* - collection-id: s: Set as collection ID in repo/config (Since 2017.9)
*
* Returns: (transfer full): A new OSTree repository reference
+ *
+ * Since: 2017.10
*/
OstreeRepo *
ostree_repo_create_at (int dfd,
*
* By default, an #OstreeRepo will cache the remote configuration and its
* own repo/config data. This API can be used to reload it.
+ *
+ * Since: 2017.2
*/
gboolean
ostree_repo_reload_config (OstreeRepo *self,
* per-remote summary caches. Setting this manually is useful when
* doing operations on a system repo as a user because you don't have
* write permissions in the repo, where the cache is normally stored.
+ *
+ * Since: 2016.5
*/
gboolean
ostree_repo_set_cache_dir (OstreeRepo *self,
* repository (to see whether a ref was written).
*
* Returns: File descriptor for repository root - owned by @self
+ * Since: 2016.4
*/
int
ostree_repo_get_dfd (OstreeRepo *self)
* this will simply be a fast Unix hard link operation.
*
* Otherwise, a copy will be performed.
+ *
+ * Since: 2016.5
*/
gboolean
ostree_repo_import_object_from_with_trust (OstreeRepo *self,
* configured for @remote.
*
* Returns: (transfer full): an #OstreeGpgVerifyResult, or %NULL on error
+ *
+ * Since: 2016.14
*/
OstreeGpgVerifyResult *
ostree_repo_verify_commit_for_remote (OstreeRepo *self,
* the verifications using GPG keys in the keyrings of all remotes.
*
* Returns: (transfer full): an #OstreeGpgVerifyResult, or %NULL on error
+ *
+ * Since: 2016.6
*/
OstreeGpgVerifyResult *
ostree_repo_gpg_verify_data (OstreeRepo *self,
if (g_str_has_prefix (line, selinuxtype_prefix))
{
- policytype = g_strstrip (g_strdup (line + strlen (selinuxtype_prefix)));
+ policytype = g_strstrip (g_strdup (line + strlen (selinuxtype_prefix)));
policy_root = g_file_get_child (etc_selinux_dir, policytype);
}
else if (g_str_has_prefix (line, selinux_prefix))
* @error: Error
*
* Returns: (transfer full): An accessor object for SELinux policy in root located at @rootfs_dfd
+ *
+ * Since: 2017.4
*/
OstreeSePolicy*
ostree_sepolicy_new_at (int rootfs_dfd,
* @self:
*
* Returns: (transfer none): Checksum of current policy
+ *
+ * Since: 2016.5
*/
const char *
ostree_sepolicy_get_csum (OstreeSePolicy *self)
* ostree_sysroot_cleanup() at some point after the transaction, or specify
* `do_postclean` in @opts. Skipping the post-transaction cleanup is useful
* if for example you want to control pruning of the repository.
+ *
+ * Since: 2017.4
*/
gboolean
ostree_sysroot_write_deployments_with_options (OstreeSysroot *self,
*
* Like ostree_sysroot_deploy_tree(), but "finalization" only occurs at OS
* shutdown time.
+ *
+ * Since: 2018.5
*/
gboolean
ostree_sysroot_stage_tree (OstreeSysroot *self,
return TRUE;
}
+/**
+ * ostree_sysroot_load_if_changed:
+ *
+ * Since: 2016.4
+ */
gboolean
ostree_sysroot_load_if_changed (OstreeSysroot *self,
gboolean *out_changed,
* @self: Sysroot
*
* Returns: (transfer none): The currently staged deployment, or %NULL if none
+ *
+ * Since: 2018.5
*/
OstreeDeployment *
ostree_sysroot_get_staged_deployment (OstreeSysroot *self)
* has been invoked successfully.
*
* Returns: (transfer none): The OSTree repository in sysroot @self.
+ *
+ * Since: 2017.7
*/
OstreeRepo *
ostree_sysroot_repo (OstreeSysroot *self)
* Initialize the directory structure for an "osname", which is a
* group of operating system deployments, with a shared `/var`. One
* is required for generating a deployment.
+ *
+ * Since: 2016.4
*/
gboolean
ostree_sysroot_init_osname (OstreeSysroot *self,
*
* The `OSTREE_DEPLOYMENT_UNLOCKED_HOTFIX` state is persistent
* across reboots.
+ *
+ * Since: 2016.4
*/
gboolean
ostree_sysroot_deployment_unlock (OstreeSysroot *self,